Skip to content

Conversation

@Fuco1
Copy link
Contributor

@Fuco1 Fuco1 commented Jun 30, 2022

Fontify the variable and type in a type guard.

Before

image

After

image

@josteink
Copy link
Member

Without delving too deep into the code, it looks like a useful improvement.

Would you be able to add tests for it, so once committed, we know it will keep working? 🙂

@Fuco1
Copy link
Contributor Author

Fuco1 commented Jun 30, 2022

Now looking at this, maybe the is should be fontified as keyword as well?

This is from VS Code where the is has the same face as the function (so keyword)

image

@Fuco1
Copy link
Contributor Author

Fuco1 commented Jun 30, 2022

I will add tests, no problem.

@Fuco1 Fuco1 force-pushed the feature/fontify-type-guard branch from 24e6a81 to f97b832 Compare June 30, 2022 17:41
@josteink
Copy link
Member

Sounds great. Fontifying “is” makes perfectly sense to me.

@Fuco1 Fuco1 force-pushed the feature/fontify-type-guard branch from f97b832 to 333a7c5 Compare June 30, 2022 21:41
@Fuco1
Copy link
Contributor Author

Fuco1 commented Jun 30, 2022

You have really neat testing setup for font-locking. I'm loving the macros :)

btw final version looks like this (also with the other PR applied to fontify the argument)

image

@josteink
Copy link
Member

josteink commented Jul 3, 2022

Looks great. Thanks for this PR :)

@josteink josteink merged commit b80ae97 into emacs-typescript:master Jul 3, 2022
@Fuco1 Fuco1 deleted the feature/fontify-type-guard branch July 4, 2022 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants